package SchoolPractical.First;

import java.util.Scanner;



public class Factorial {
    //(1)编写应用程序, 求一个自然数N的阶乘。
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N =  sc.nextInt();
        System.out.println(new Factorial().factorial(N));
    }

    public int factorial(int N) {
        if (N == 1) {
            return N;
        }
        if (N < 0) {
            return -1;
        }
        if (N == 0) {
            return 1;
        }
        return factorial(N - 1) * N;
    }

}


